import App from './App'
import constant from 'public/constant'
import {myRequest} from './util/api.js'
//引入vuex


Vue.prototype.$constant = constant;
Vue.prototype.$myRequest = myRequest;


Vue.filter('snippet',function(val){
	if( val.length > 4){
		return val.slice(0,4) + "...";
	}else{
		return val;
	}
	
})


Vue.filter('dateFormat',function(originVal){
  const dt = new Date(originVal)
  
  const y = dt.getFullYear()
  const m = (dt.getMonth() + 1 + '').padStart(2,'0')
  const d = (dt.getDate() + '').padStart(2,'0')

  const hh = (dt.getHours() + '').padStart(2,'0')
  const mm = (dt.getMinutes() + '').padStart(2,'0')
  const ss = (dt.getSeconds() + '').padStart(2,'0')

  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})


// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif